feat: Add installation targets for libbarretenberg, wasm & headers#185
Merged
Conversation
Author
|
I found a couple more things that needed to change to install all headers got installed:
|
codygunton
approved these changes
Mar 6, 2023
963e40e to
f663ecd
Compare
f663ecd to
80317d9
Compare
11 tasks
This was referenced Mar 6, 2023
dbanks12
reviewed
Mar 7, 2023
| INTERFACE | ||
| FILE_SET HEADERS | ||
| FILES ${HEADER_FILES} | ||
| ) |
There was a problem hiding this comment.
Is this only necessary here because common is not a barretenberg_module?
dbanks12
reviewed
Mar 7, 2023
| EXPORT barretenbergTargets | ||
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
| ) |
There was a problem hiding this comment.
Could you add a comment explaining what this is doing (especially for EXPORT and each DESTINATION arg). I had to look it up and I'm sure others will too. Still not 100% sure I know what this command is doing after doing a bit of digging.
11 tasks
ludamad
pushed a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Jul 22, 2023
…ztecProtocol/barretenberg#185) * feat: Add installation targets for libbarretenberg, wasm & headers * chore: Disable installation targets for gtest & benchmark * Collect tcc files for headers * Collect common headers for install target * chore(docs): Add installation section to README.
ludamad
pushed a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Jul 24, 2023
…ztecProtocol/barretenberg#185) * feat: Add installation targets for libbarretenberg, wasm & headers * chore: Disable installation targets for gtest & benchmark * Collect tcc files for headers * Collect common headers for install target * chore(docs): Add installation section to README.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #176
This adds install targets for
libbarretenberg.a,barretenberg.wasmand all the headers. It uses an "interface library" to collect headers as the subdirectories call thebarretenberg_modulefunction. I couldn't come up with a better way to collect the headers for installation because they exist in the subdirectories (instead of something like aninclude/directory where the public headers exist, such as https://github.com/google/benchmark/tree/main/include/benchmark), which means that we promote all header files instead of just public ones.We should open a follow up issue to differentiate public from private headers.
With installation targets, we can now do
cmake --install build --prefix "/usr/local"and it'll install like a normal C++ library.I also added the
INSTALL_BARRETENBERGoption in emulation of googletest and benchmark because usingFetchContent_MakeAvailablewill add them as install targets. You can see how theBENCHMARK_ENABLE_INSTALLandINSTALL_GTESTare turned off now too.This is the minimal setup we need to have installation targets, but many more improvements can be made so projects can consume this via other CMake builds, pkg-config, etc. These improvements are currently unnecessary for Noir to use barretenberg, but I can create follow up issues.
Checklist:
/markdown/specshave been updated.@briefdescribing the intended functionality.